#include <iostream>

using namespace std;

const int N = 1e6 + 10;

typedef long long LL;

int T;
int n;

int arr[N];
LL sum;

int main()
{
	cin >> T;

	while (T--)
	{
		cin >> n;
		for (int i = 1; i <= n; i++)
		{
			cin >> arr[i];
		}
		for (int i = 2; i <= n; i++)
			sum += arr[i];

		cout << sum << endl;
	}

	return 0;
}